const fs = require('fs');
const path = require('path');
const auth = require('../middleware/auth');
const router = require('express').Router();
const bookPath = path.resolve(__dirname, '../books/');

/* GET home page. */
router.get('/', auth.loginRequired, function(req, res, next) {
	global.navlist = 0;
	res.render('index');
});
router.post('/creates', function(req, res, next) {
	console.log(1);
	fs.mkdirSync(path.join(bookPath, '123123123'));
	console.log(2);
	res.json({
		code: 200
	})
})

module.exports = router;